import request from '@/utils/request'

// 查询服务承诺列表
export function listCommitment(query) {
  return request({
    url: '/prod-api/supplier/commitment/list',
    method: 'get',
    params: query
  })
}

// 查询服务承诺详细
export function getCommitment(commitmentUid) {
  return request({
    url: '/prod-api/supplier/commitment/' + commitmentUid,
    method: 'get'
  })
}

// 新增服务承诺
export function addCommitment(data) {
  return request({
    url: '/prod-api/supplier/commitment',
    method: 'post',
    data: data
  })
}

// 修改服务承诺
export function updateCommitment(data) {
  return request({
    url: '/prod-api/supplier/commitment',
    method: 'put',
    data: data
  })
}

// 删除服务承诺
export function delCommitment(commitmentUid) {
  return request({
    url: '/prod-api/supplier/commitment/' + commitmentUid,
    method: 'delete'
  })
}

// 修改服务状态
export function updateDataStatus(commitmentUid, dataStatus,supplierUid){
  const data = {
    commitmentUid,
    dataStatus,
    supplierUid
  }
  return request({
    url: '/prod-api/supplier/commitment/updateDataStatus',
    method: 'put',
    data: data
  })
}
